<?php
/**
 * Esto no es un action controller, lo puse aca transitoriamente.
 * Implementa el server que saca de la cola y despues manda los mails
 */
class MailerWS_ServerController extends Ext_Controller_Action
{

    public function handleAction()
    {
        if ( Zend_Controller_Action_HelperBroker::hasHelper( 'layout' ) ) {
            $this->_helper->layout->disableLayout();
        }
        $this->_helper->viewRenderer->setNoRender();
        $queue = $this->getResource('Queue')->getQueue( 'main' );
        $errQueue = $this->getResource('Queue')->getQueue( 'error' );
        $server = new Ext_Queue_RpcServer( $queue, 'Ext_Mailer_Server', $this->_config );
        $server->handleUntilEmpty( $errQueue );
    }
}